#include <unistd.h>
#include "Shm.hpp"
#include "NamedPipe.hpp"

int main()
{
    Shm shm(PATHNAME, PROJ_ID, SHMSIZE, shmUser);
    int maxSize = shm.Size() - 1;
    char *add = (char *)shm.Add();

    namedPipe fifo(user);
    fifo.OpenPipeForWrite();

    char c = 'A';
    while (c <= 'Z')
    {
        sleep(1);
        add[c - 'A'] = c;
        fifo.WriteToFifo("d");
        std::cout << "client write " << c << " done" << std::endl;
        ++c;
    }
    fifo.WriteToFifo("q");
    return 0;
}